package com.study.d1_stream;

import java.util.*;
import java.util.stream.Stream;

public class Test2 {
    public static void main(String[] args) {
        //获取Stream流
        //1、获取集合的Stream流
        Collection<String> list = new ArrayList<>();
        Collections.addAll(list,"哈哈","呵呵","嘿嘿");
        Stream<String> stream = list.stream();
        System.out.println(stream.count());

        Map<String,Integer> map = new HashMap<>();
        Stream<String> stream1 = map.keySet().stream();
        Stream<Integer> stream2 = map.values().stream();
        Stream<Map.Entry<String, Integer>> stream3 = map.entrySet().stream();

        String[] names = new String[5];
        Stream<String> stream4 = Arrays.stream(names);
        Stream<String> stream5 = Stream.of(names);
    }
}
